package 每日一题;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class OR63删除公共字符 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str1=sc.nextLine();
        String str2=sc.nextLine();
        System.out.print(fun(str1,str2));
    }

    private static String fun(String str1, String str2) {
        char[] chars1 = str1.toCharArray();
        char[] chars2 = str2.toCharArray();
        StringBuilder sb=new StringBuilder();

        Map<Character,Integer> map=new HashMap<>();
        for(char c:chars2){
            map.put(c,map.getOrDefault(c,0)+1);
        }
        for (char c:chars1) {
            if (!map.containsKey(c)) {
                sb.append(c);
            }
        }
        return sb.toString();
    }
}
